package com.java.multipledatasource.spring.batis;

import org.apache.ibatis.annotations.Select;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author huxb
 * @date 2020/10/18 0018 下午 6:30
 * @Desciption
 */
public class LuBanInvocationHandler implements InvocationHandler {
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.err.println("connect db");
        Select annotation = method.getAnnotation(Select.class);
        String[] value = annotation.value();
        String sql =  value[0];
        System.err.println(sql);
      //  Class<?> returnType = method.getReturnType();
        return null;
    }
}
